package dao

// GetPageOffset 获取分页Offset
func GetPageOffset(page, limit int) int {
	offset := -1
	if page > 0 {
		offset = (page - 1) * limit
	}
	return offset
}

// GetPageLimit 获取分页的offset
func GetPageLimit(limit int) int {
	if limit <= 0 {
		limit = -1
	}
	return limit
}
